package models;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

@javax.persistence.Entity
@Table(name = "materia_grado")
@IdClass(MateriaGradoId.class)
public class MateriaGrado extends Entity<MateriaGradoId> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "id_materia")
	private Long idMateria;

	@Id
	@Column(name = "id_colegio")
	private Long idColegio;

	@Id
	@Column(name = "id_grado")
	private Long idGrado;

	public MateriaGrado() {

	}

	public MateriaGrado(Long idMateria, Long idColegio, Long idGrado) {
		super();
		this.idMateria = idMateria;
		this.idColegio = idColegio;
		this.idGrado = idGrado;
	}

	@Override
	public MateriaGradoId getId() {
		return new MateriaGradoId(idMateria, idColegio, idGrado);
	}

	@Override
	public void setId(MateriaGradoId id) {
		this.idMateria = id.getIdMateria();
		this.idColegio = id.getIdColegio();
		this.idGrado = id.getIdGrado();
	}

	public Long getIdMateria() {
		return idMateria;
	}

	public void setIdMateria(Long idMateria) {
		this.idMateria = idMateria;
	}

	public Long getIdColegio() {
		return idColegio;
	}

	public void setIdColegio(Long idColegio) {
		this.idColegio = idColegio;
	}

	public Long getIdGrado() {
		return idGrado;
	}

	public void setIdGrado(Long idGrado) {
		this.idGrado = idGrado;
	}

}
